package com.zrq.core.dto.response;

import com.zrq.core.constant.Constant;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;

@Data
@Builder
public class APIResponse<R> {

    public static <R> APIResponse<R> makeSuccess(R data) {
        return APIResponse.<R>builder()
                .code(Constant.SUCCESS)
                .data(data)
                .build();
    }


    private Integer code;

    private R data;

    @Tolerate
    public APIResponse() {
    }

}
